package com.dfrz.household.service;/*
 * @创建者：黄苟苟
 * @创建时间：2021/8/17   19:23
 * @Description描述
 **/

import com.dfrz.household.bean.Server;
import com.dfrz.household.mapper.ServerMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class ServerServiceImpl implements ServerService {
    @Autowired
    ServerMapper serverMapper;
    @Override
    public List <Server> getAllServers() {
        List<Server> servers = new ArrayList <>();
        servers=serverMapper.getAllServers();
        return servers;
    }

    @Override
    public List <Server> getAllServersByType() {
        return serverMapper.getAllServerByType();
    }

    @Override
    public List <Server> getAllServerByPager() {
        return null;
    }

    @Override
    public Map <String, Server> getAllServer() {
       Map<String, Server> servermap = new HashMap<>();
       servermap=serverMapper.getAllServer();
       return servermap;
    }



    @Override
    public Server getServerById(Integer id) {
        Server server=new Server();
        server=serverMapper.getserverById(id);
        return server;
    }

    @Override
    public Server getServerByTypeId(Integer id) {
        return serverMapper.getserverByTypeId(id);
    }
}
